<template>
  <div class="demo">
    <template>
      <div v-if="mode === 'edit'">
        <van-uploader
          v-model="fileList"
          :max-count="limitCount"
          :preview-full-image="false"
          :disabled="disabled"
        >
          <van-button type="primary">{{ btnText }}</van-button>
        </van-uploader>
      </div>
      <div v-else>{{ value }}</div>
    </template>
  </div>
</template>

<script>
export default {
  name: "license",
  components: {},
  props: {
    value: {},
    mode: {
      default: "edit", // 编辑模式和 edit， 展示模式 view
    },
    readonly: {
      type: Boolean,
      default: false,
    },
    disabled: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      btnText: "电子证照",
      limitCount: 1,
      fileList: [],
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {
    if (this.value) {
      if (this.mode == "view") {
        this.disabled = true;
      }
    }
  },
  methods: {},
};
</script>
<style lang="scss" scoped>
.demo {
  width: 100%;
}
</style>
